package 笔试真题;

import java.util.Arrays;
import java.util.Scanner;

public class Tengxun3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        while (k-->0){
            int n = scanner.nextInt();
            int w = scanner.nextInt();
            int[] values = new int[n];
            for (int i = 0; i < n; i++) {
                values[i] = scanner.nextInt();
            }
            Arrays.sort(values);
            int left =0 ,right = n-1;
            int ans =0 ;
            while (true){
                if(values[left] + values[right] > w || (values[right ] + values[left])%2 !=0){
                    right--;
                    ans ++;
                }else {
                    right--;
                    left++;
                    ans++;
                }
                if(left>=right) {
                    if(left==right) ans ++;
                    break;
                }
            }
            System.out.println(ans);
        }
    }
}
